﻿<?php
if(isset($_REQUEST['flag'])) {

	$flag = $_REQUEST['flag'];
	$phone = $_REQUEST['phone'];
	$pwd = $_REQUEST['pwd'];
	$step = $_REQUEST['step'];

	if($flag == '1') {
		$sevpwd=$_REQUEST['sevpwd'];
		if($sevpwd != 'yuan'){
			echo "{\"code\":\"404\",\"msg\":\"服务器密码错误\"}";
			exit;
		}
		$url = 'http://127.0.0.1:19999/Service/updateStep?phone='. $phone .'&password='. $pwd .'&steps='. $step .'&flag=1';
		$result = file_get_contents($url);
		echo $result;

	} else {
		$url = 'http://127.0.0.1:20002/h-autoStep/stepApi.php?mobile='. $phone .'&psw='. $pwd .'&step='. $step;
		$result = file_get_contents($url);
		echo $result;
	}

	exit;
 }
?>

<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>乐心刷步</title>
	<link rel="stylesheet" type="text/css" href="css/styles.css">
	<!--弹窗样式-->
	<link rel="stylesheet" type="text/css" href="css/xtiper.css">
</head>
<body>
<div class="htmleaf-container">
	<div class="wrapper">
		<div class="container">
			<h1>Welcome</h1>
			
			<form class="form" action="./" method="post" id='port_form'>
				<input type="text" placeholder="Phone" name="phone" id="phone">
				<input type="password" placeholder="Password" name="pwd" id="pwd">
				<input type="text" placeholder="step" name="step" id="step">
				<input type="hidden" name="flag" id='flag' value='0' id="flag">
				<button type='button' id="mul-button" style="width:130px">手动</button>
				<button type='button' id="auto-button" style="width:130px">自动</button>
			</form>
		</div>
		<ul class="bg-bubbles">
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
		</ul>
	</div>
</div>
	<script src="https://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script> 
	<script src="js/xtiper.min.js" type="text/javascript"></script>
	<script src="js/login.js"></script>
</body>
</html>'
